
R3F_FNCT_Teleport = {
	private ["_return","_item","_unit","_destination","_position"];
	_return = false;
	if ((count _this) != 2) exitWith {_return};
	_item = _this select 0;
	if (((typeName _item) != "STRING") || (_item == "")) exitWith {_return};
	_unit = [_item] call R3F_FNCT_WhoIs;
	if !(isPlayer _unit) exitWith {_return};
	_destination = _this select 1;
	_position = switch (typeName _destination) do {
		case "STRING"	: {getPosATL ([_destination] call R3F_FNCT_WhoIs);};
		case "ARRAY"	: {_destination;};
		case "GROUP"	: {getPosATL (leader _destination);};
		case "OBJECT"	: {getPosATL _destination;};
		default {false;};
	};
	if ((typeName _position) != "ARRAY") exitWith {_return};
	_unit setPosATL _position;
	_return = true;
	_return
};
R3F_FNCT_PosCam = {
	private "_position";
	_position = [0,0,0];
	sleep 10;
	if (!isNil "BIS_DEBUG_CAM") then {
		while {!isNil "BIS_DEBUG_CAM"} do {
			_position = getPosATL BIS_DEBUG_CAM;
			copyToClipboard (str _position);
			sleep 1;
		};
	if !(isNil "ACV_PosClick") then {ACV_PosClick = _position;};
	};
	_position;
};
R3F_FNCT_Catapulte = {
	private ["_item","_unit","_vehicle","_class","_simulation","_direction"];
	if (count _this > 0) then {
		_item = _this select 0;
		if (typeName _item == "STRING") then {
			_unit = [_item] call R3F_FNCT_WhoIs;
		} else {
			if (typeName _item == "GROUP") then {
				_unit = leader _item;
			} else {
				_unit = _item;
			};
		};
	} else {
		sleep 15;
		_unit = player;
	};
	if (typeName _unit != "OBJECT") exitWith {};
	_vehicle = vehicle _unit;
	_class = typeOf _vehicle;
	_simulation = getText (configFile >> "CfgVehicles" >> _class >> "simulation");
	_direction = getDir _vehicle;
	if (_simulation == "helicopter") then {
		_vehicle setVelocity [50 * (sin _direction),50 * (cos _direction),100];
	} else {
		if (_simulation == "airplane") then {
			_vehicle setVelocity [150 * (sin _direction),150 * (cos _direction),100];
		} else {
			if (_vehicle == _unit) then {
				_vehicle setVelocity [100 * (sin _direction),100 * (cos _direction),300];
				_unit addAction ["HALO" call R3F_FNCT_Blue,"tmf\core\modules\r3f_acv\Scripts\halo.sqf",[],1,false,false,"","((getPosATL _this) select 2) > 50"];
			};
		};
	};
};
R3F_FNCT_Azimut = {
	private ["_direction","_item","_object1","_object2"];
	_direction = -1;
	if ((count _this) == 2) then {
		_item = _this select 0;
		if (isNil "_item") exitWith {};
		_object1 = [_item] call R3F_FNCT_GetPos;
		if (count _object1 == 0) exitWith {};
		_item = _this select 1;
		if (isNil "_item") exitWith {};
		_object2 = [_item] call R3F_FNCT_GetPos;
		if (count _object2 == 0) exitWith {};
		_direction = ((_object2 select 0) - (_object1 select 0)) atan2 ((_object2 select 1) - (_object1 select 1));
		if (_direction < 0) then {
			_direction = _direction + 360;
		};
	};
	_direction = _direction % 360;
	hintSilent format ["%1",round _direction];
	_direction
};
R3F_FNCT_PosPlayer = {
	private "_position";
	_position = getPosATL player;
	hintSilent format ["Coord %1\n\nPosition : %2",mapGridPosition _position,_position];
	copyToClipboard (str _position);
	_position
};